package automateWebElements;

import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.Assert;

public class IsElementActiveOrNot {
    public static void main(String[] args) {
        FirefoxDriver driver = new FirefoxDriver();
        driver.get("https://rahulshettyacademy.com/dropdownsPractise/");
//        System.out.println(driver.findElementByXPath("//input[@id='ctl00_mainContent_view_date2']").isEnabled());
//        System.out.println(driver.findElementById("Div1").getAttribute("style"));
        driver.findElementByXPath("//input[@value='RoundTrip']").click();
//        System.out.println(driver.findElementById("Div1").getAttribute("style"));

        if (driver.findElementById("Div1").getAttribute("style").contains("1")) {
            System.out.println("Element is enabled");
            Assert.assertTrue(true);
        } else {
            Assert.assertTrue(false);
        }
    }
}
